package com.sun.evening.controller;

import com.sun.evening.core.common.Result;
import com.sun.evening.service.AdminService;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/root")
public class AdminController {
    @Resource
    private AdminService adminservice;
    @PostMapping("/insertImageList")
    @ApiModelProperty("批量上传图片")
    public Result setImageList (@RequestParam("imageList") List<MultipartFile> imageList, String path) throws Exception {
        return adminservice.insertImagesList(imageList,path);
    }

    @PostMapping("/insertUserList")
    @ApiModelProperty("批量插入测试用户")
    public Result setUserList(@RequestParam("users")List<String> openIdList){
        return adminservice.insertUserList(openIdList);
    }

}
